package com.tg.app.camera;

import com.tg.appcommon.android.Packet;

/**
 * 行车记录仪灵敏度
 *
 * 注意 读写的时候，需要根据 scene 分场景
 */
public interface TciCmdGsensor {
    int TCI_CMD_SET_GSENSOR = 0x432; ///< 设置g-sensor配置
    int TCI_CMD_GET_GSENSOR = 0x434; ///< 获取g-sensor配置
    int TCI_CMD_GET_GSENSOR_RESP = 0x435;

    int GSENSOR_SCENE_DRIVING = 0; // 车辆运行中
    int GSENSOR_SCENE_PARKING = 1; // 停车状态

    static byte[] parseRespContent(int type, int scene) {

        byte[] result = new byte[8];
        byte[] typeByte = Packet.intToByteArray_Little(type);
        byte[] sceneByte = Packet.intToByteArray_Little(scene);
        System.arraycopy(typeByte, 0, result, 0, 4);
        System.arraycopy(sceneByte, 0, result, 4, 4);
        return result;
    }

    static byte[] parseReqContent(int scene) {

        byte[] result = new byte[8];
        byte[] sceneByte = Packet.intToByteArray_Little(scene);
        System.arraycopy(sceneByte, 0, result, 0, 4);
        return result;
    }
}
